//
//  ICEWDPNavigationBar.m
//  ICEH5Bridge
//
//  Created by wujianrong on 2017/8/16.
//  Copyright © 2017年 wanda. All rights reserved.
//

#import "ICEEMNavigationBar.h"
#import "ICEUI.h"
#import "ICECore.h"
#import "ICEJavaScriptBridge.h"

@implementation ICEEMNavigationBar
-(void)updateBar:(NSDictionary*)args
{
    NSDictionary* param = [args objectForKey:@"param"];
    
    NSString* leftTitle = [param objectForKey:@"leftTitle"];
    NSString* leftUrl = [param objectForKey:@"leftUrl"];
    NSString* leftAction = [param objectForKey:@"leftAction"];
    NSString* rightTitle = [param objectForKey:@"rightTitle"];
    NSString* rightAction = [param objectForKey:@"rightAction"];
    NSString* rightUrl = [param objectForKey:@"rightUrl"];
    NSString* title = [param objectForKey:@"navigatorTitle"];
    NSString* status = [param objectForKey:@"status"];
    if(ICESafeString(rightTitle).length <=0){
        
        rightTitle = @" ";
    }
    ICEWebInfo* vcinfo = [args objectForKey:@"vcinfo"];
    if (vcinfo.vc) {
        [vcinfo.vc updateNavigationBarWithLeftTitle:leftTitle leftAction:leftAction rightTitle:rightTitle rightAction:rightAction navigatorTitle:title leftUrl:ICESafeString(leftUrl) rightUrl:ICESafeString(rightUrl) navigationBarStatus:status args:args];
    }
   
    NSDictionary* ret = nil;
    ret = @{
            @"status":@"success",
            };
    
    [ICEJavaScriptBridge sendReslutToJS:ret callInfo:args];
}
@end
